/*
 * interface for environment data structure.
 *
 * local environment - values of arguments of some lambda.
 * environment - values of arguments of all external lambdas.
 */

#ifndef __ENV_H
#define __ENV_H

#include "schemeobject.h"

/* implemented as arrays */
typedef SchemeObject** LocalEnv ; /* array of sob pointers */
typedef LocalEnv* Environment ;

extern Environment emptyEnv ;

Environment extendEnv(Environment env, LocalEnv local) ; // extends an existing environment with a local environment.
LocalEnv makeLocalEnv(SchemeObject** args, Amount size) ; // creates a local environment on the heap from stack arguments
SchemeObject* getBoundVar(Environment env, unsigned major, unsigned minor) ;
void setBoundVar(Environment env, unsigned major, unsigned minor, SchemeObject* val) ;

#endif /* __ENV_H */
